package com.lbt.mybatis.plus.extend.expression;

/**
 * @author zhangjinyu
 * @since 2023-05-16
 */
public enum SqlExpression {
    EQ("? = ?"),
    IEQ("? ~* ?"),
    NE("? <> ?"),
    GT("? > ?"),
    GE("? >= ?"),
    LT("? < ?"),
    LE("? <= ?"),
    BETWEEN("? BETWEEN ? AND ?"),
    NOT_BETWEEN("? NOT BETWEEN ? AND ?"),
    LIKE("? LIKE CONCAT('%', ?, '%')"),
    ILIKE("? ILIKE CONCAT('%', ?, '%')"),
    NOT_LIKE("? NOT LIKE CONCAT('%', ?, '%')"),
    NOT_ILIKE("? NOT ILIKE CONCAT('%', ?, '%')"),
    LIKE_LEFT("? LIKE CONCAT(?, '%')"),
    ILIKE_LEFT("? ILIKE CONCAT(?, '%')"),
    NOT_LIKE_LEFT("? NOT LIKE CONCAT(?, '%')"),
    NOT_ILIKE_LEFT("? NOT ILIKE CONCAT(?, '%')"),
    LIKE_RIGHT("? LIKE CONCAT('%', ?)"),
    ILIKE_RIGHT("? ILIKE CONCAT('%', ?)"),
    NOT_LIKE_RIGHT("? NOT LIKE CONCAT('%', ?)"),
    NOT_ILIKE_RIGHT("? NOT LIKE CONCAT('%', ?)"),
    IN("? IN (?)"),
    NOT_IN("? NOT IN (?)"),
    IS_NULL("? IS NULL"),
    NOT_NULL("? IS NULL"),
    IS_BLANK("? = ''"),
    EXISTS("? EXISTS (?)"),
    ;
    public static final String PLACE_HOLDER = "?";
    final String expression;

    SqlExpression(String expression) {
        this.expression = expression;
    }

    public String getExpression() {
        return expression;
    }
}
